﻿using A.M.Storage.Application;
using A.M.Storage.I_Infrastruecure;
using Microsoft.AspNetCore.Http.HttpResults;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using W.M.Materiel.Application.IServices;
using W.M.Materiel.Domain.Entity;
using W.M.Materiel.Infrastruecure.IRepository;

namespace W.M.Materiel.Application.Services
{
    public class Multistage_price_tableServices : BaseServices<multistage_price_table, string>, IMultistage_price_tableServices
    {
        private readonly IMultistage_price_tableRepository multistage_Price_TableRepository;

        public Multistage_price_tableServices(IMultistage_price_tableRepository multistage_Price_TableRepository) : base(multistage_Price_TableRepository)
        {
            this.multistage_Price_TableRepository = multistage_Price_TableRepository;
        }

        /// <summary>
        /// 显示多级售价表信息
        /// </summary>
        /// <returns></returns>
        public async Task<List<multistage_price_table>> GetMultistage_Price_Table()
        {
            var list =await multistage_Price_TableRepository.GetShowInforAsync();
            return list;
        }

        /// <summary>
        /// 反填产品信息
        /// </summary>
        /// <param name="bom_number">产品编号</param>
        /// <returns>产品数据</returns>
        public async Task<multistage_price_table> GetBillbackfill(int? selling_number)
        {
            Expression<Func<multistage_price_table, bool>> wherename = x => x.selling_number == selling_number;
            var list = await multistage_Price_TableRepository.GetShowObjAsync(wherename);
            return list;
        }
    }
}
